import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.*;

public class ceshi {
    public static void main(String[] args) throws IOException {
//        XSSFWorkbook sheets = new XSSFWorkbook(new FileInputStream(new File("D:\\01_java\\JavaEE就业29期·激活码.xlsx")));
//        XSSFSheet sheetAt = sheets.getSheetAt(0);
//        for (Row cells : sheetAt) {
//            for (Cell cell : cells) {
//                System.out.print(cell+"\t");
//            }
//            System.out.println();
//        }
//        sheets.close();

        XSSFWorkbook excel = new XSSFWorkbook();
        XSSFSheet sheet = excel.createSheet("我的一科四赛欧表");
        XSSFRow row = sheet.createRow(0);
        row.createCell(0).setCellValue("姓名");
        row.createCell(1).setCellValue("地址");
        XSSFRow row1 = sheet.createRow(1);
        row1.createCell(0).setCellValue("小明");
        row1.createCell(1).setCellValue("火星");
        FileOutputStream fileOutputStream = new FileOutputStream("D:\\01_java\\我的一科四赛欧.xlsx");
        excel.write(fileOutputStream);
        fileOutputStream.flush();
        fileOutputStream.close();
        excel.close();
    }
}
